#include <cstdio>
#include <cstring>

#define MAXN 10+2
#define MAXL 60+2

int M;
char S[MAXN][MAXL];

bool my_strstr(char *s1, int l1, char *s2, int l2) {
    int i, j;
    for (i=0; i<=l2-l1; i++) {
        for (j=0; j<l1; j++) {
            if (s2[i+j] != s1[j]) {
                break;
            }
        }
        if (j>=l1) return true;
    }
    return false;
}

int my_strcmp(char *s1, char *s2, int len) {
    for (int i=0; i<len; i++) {
        if (s1[i] < s2[i]) return -1;
        if (s1[i] > s2[i]) return 1;
    }
    return 0;
}

int main() {
    int k;
    scanf("%d", &k);
    while (k--) {
        scanf("%d", &M);
        for (int i=0; i<M; i++) {
            scanf("%s", S[i]);
        }
        int len;
        bool flag = false;
        bool first = true;
        char result[MAXL] = {0};
        for (len = 60; len >= 3; len--) {
            for (int i=0; i<=60-len; i++) {
                bool fail = false;
                for (int j=1; j<M; j++) {
                    if (!my_strstr(S[0]+i, len, S[j], 60)) {
                        fail = true;
                        break;
                    }
                }
                if (!fail) {
                    if (first) {
                        first = false;
                        memcpy(result, S[0]+i, len);
                        result[len] = 0;
                    } else {
                        if (my_strcmp(result, S[0]+i, len) > 0) {
                            memcpy(result, S[0]+i, len);
                            result[len] = 0;
                        }
                    }
                    flag = true;
                }
            }
            if (flag) break;
        }
        if (!flag) {
            printf("no significant commonalities\n");
        } else {
            printf("%s\n", result);
        }
    }
    return 0;
}